<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>我的良品</title>
			<link rel="icon" type="image/png" href="http://m.lppz.com/images/favicon.png">
		
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../lib/weui.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/jquery-weui.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
	</head>
	<body>
		<script src="../lib/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<div class="weui-row header">
			<div class="header_prev">
				<a href="javascript:void;"><i class="iconfont">&#xe6d4;</i></a>
			</div>
			<div class="header_title">登陆</div>
		</div>
		<section class="content weui-row weui-no-gutter">
			<div class="con_brand weui-col-100">
				<img src="../img/logo_login.png"/>
			</div>
			<form action="" method="post" class="weui-col-100 weui-row" onsubmit="return false">
				<div class="lp-form-group weui-col-100">
					<i class="iconfont lp-form-group-icon">&#xe60d;</i>
					<input type="text" name="username" id="username" placeholder="用户名/手机号" class="lp-form-group-field" />
				</div>
				<div class="lp-form-group weui-col-100">
					<i class="iconfont lp-form-group-icon">&#xe63f;</i>
					<input type="password" name="password" id="password" placeholder="登陆密码" class="lp-form-group-field" />
				</div>
				<div class="lp-form-group weui-col-100">
					<button class="weui_btn lp-form-group-btn">登陆</button>
				</div>
				<div class="lp-form-group weui-col-100">
					<p class="fl">快速注册<a href="../reg/reg.html">已有会员卡，我要激活</a></p>
					<p class="fr">找回密码</p>
				</div>
				<div class="lp-other weui-col-100">
					<dl>
						<dt>
							<span>第三方账号快速登陆</span>
						</dt>
						<dd>
							<a href="#">
								<i class="iconfont qq"></i>
								<span>QQ登陆</span>
							</a>
						</dd>
						<dd class="tc">
							<a href="#">
								<i class="iconfont weibo"></i>
								<span>微博登陆</span>
							</a>
						</dd>
						<dd class="tr">
							<a href="#">
								<i class="iconfont alipay"></i>
								<span>支付宝登陆</span>
							</a>
						</dd>
					</dl>
				</div>
			</form>
		</section>
		<script src="../js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(".header_prev").click(function(){
				window.history.back();
			})
			$(".lp-form-group-field").eq(0).blur(function(){
				var phoneReg = /^1[3|4|5|7|8|]\d{9}$/;
				if(!phoneReg.test($(this).val())){
					$.alert("手机号输入有误");
				}
			})
			$('.lp-form-group-btn').click(function(){
				var user = localStorage.user;
				var login_name = $(".lp-form-group-field").eq(0).val();
				var login_pwd = $(".lp-form-group-field").eq(1).val();
				if(user == login_name && login_pwd == "1234"){
					$.toast("登陆成功");
					setTimeout(function(){
						window.location.href = "../cart/cart.html";
					},2000)
				}else if(user == login_name && login_pwd != "1234"){
					$.alert("密码输入错误");
				}else{
					$.alert("不存在该用户，请注册");
				}
			})
		</script>
	</body>
</html>